package com.daiyilu.common;

import java.io.Serializable;

public class Page implements Serializable {

    //每次获取数据最大条数 默认最大5000条数据
    public static Integer MAX_ROWS = 5000;
    //总记录数
    private Integer total = 0;
    //总页数
    private Integer totalPage = 0;
    //每页显示数据条数
    private Integer pageSize = 0;
    //当前第几页
    private Integer currentPage = 0;


    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        if(null == totalPage) totalPage = 0;
        this.totalPage = totalPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        if(null == pageSize) pageSize = 0;
        this.pageSize = pageSize > MAX_ROWS ? MAX_ROWS:pageSize;
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        if(null == currentPage) currentPage = 0;
        this.currentPage = currentPage;
    }
}
